package com.itheima;

public class StuDemo_plus {
    public static void main(String[] args) {

        Student_plus st = new Student_plus();
        System.out.println("The name is :" + st.getName());
        System.out.println("The age is :" + st.getAge());

        st.setName("Mark");
        st.setAge(20);
        System.out.println("The name is :" + st.getName());
        System.out.println("The age is :" + st.getAge());

        Student_plus st1 = new Student_plus("Mark",20);
        System.out.println("The name is :" + st1.getName());
        System.out.println("The age is :" + st1.getAge());
        System.out.println("--------");
        System.out.println(st == st1);         //比较两个对象的地址值是否相同
        System.out.println(st.equals(st1));    //重写equals方法后，比较两个对象的内容是否相同
        System.out.println(st);    //重写 toString方法后，输出结果变得易于识别
    }
}
